#ifndef LOG_H
#define LOG_H

#include <time.h>
#include <stdarg.h>
#include <fstream>
#include <iostream>
#include <string>
void logd(const char* fmt, ...) {

    // time
    time_t now = time(nullptr);
    struct tm* tm = localtime(&now);
    printf("%04d-%02d-%02d %02d:%02d:%02d ",
        tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday,
        tm->tm_hour, tm->tm_min, tm->tm_sec);

    printf("[D] ");

    if (fmt == nullptr) {
        printf("\n");
        return;
    }

    va_list args;
    va_start(args, fmt);
    vprintf(fmt, args);
    va_end(args);
}

#endif